package com.fessc.develop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fessc.develop.entity.dbvo.TCheckResultList;
import com.fessc.develop.mapper.TCheckResultListMapper;
import com.fessc.develop.service.interfaces.ITCheckResultListService;
import com.fessc.develop.utils.BusiUtil;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author y
 * @since 2025-03-14
 */
@Service
public class TCheckResultListServiceImpl extends ServiceImpl<TCheckResultListMapper, TCheckResultList> implements ITCheckResultListService {


    /**
     * 根据批次号删除
     *
     * @param bankId 银行编号
     * @param batchNo 批次号
     * @param checkType 对账类型
     */
    @Override
    public boolean deleteCheckResultListByBatchNo(String bankId, String batchNo, String checkType) {
        QueryWrapper<TCheckResultList> queryWrapper = new QueryWrapper<>();
        if (BusiUtil.isNotNullAll(bankId, batchNo, checkType)) {
            queryWrapper.eq("bank_id", bankId);
            queryWrapper.eq("batch_no", batchNo);
            queryWrapper.eq("check_type", checkType);
            return this.remove(queryWrapper); // 执行删除操作
        }else {
            return false;
        }
    }
}
